<template>
  <div>
    <DataTable v-if="!allowEditMenu"></DataTable>
    <DataForm v-else></DataForm>
  </div>
</template>

<script setup lang="ts">
import { list } from './data/curd';
import { allowEditMenu } from './data/data';
import { resetForm } from './data/form';
import DataForm from './pages/data-form.vue';
import DataTable from './pages/data-table.vue';

onMounted(() => {
  list();
});

onUnmounted(() => {
  resetForm();
  allowEditMenu.value = false;
});
</script>

<style lang="scss" scoped></style>
